package problem172;

//172.阶乘后的零
//https://leetcode.cn/problems/factorial-trailing-zeroes/?envType=study-plan-v2&envId=top-interview-150

class Solution {
    public int trailingZeroes(int n) {
        int ret = 0;
        for(int i = 1; i<=n; i++) {
            int t = i;
            while(t > 0) {
                if(t % 5 == 0) {
                    ret++;
                }else {
                    break;
                }
                t /= 5;
            }
        }
        return ret;
    }
}
